#coding: utf-8
import datastructures        as DataStructures
import dynamicdatastructures as DynamicDataStructures

if __name__ == "__main__":
    """
    # Stack.
    stack = DataStructures.Stack(12)
    stack.show()
    stack.push(20)
    stack.push(30)
    stack.push(40)
    stack.show()
    print stack.pop()
    stack.push(50)
    print stack.top()
    stack.show()
    
    # Queue
    queue = DataStructures.Queue(12)
    queue.show()
    queue.enqueue(10)
    queue.enqueue(20)
    queue.enqueue(30)
    queue.show()
    print queue.dequeue()
    queue.enqueue(40)
    print queue.top()
    queue.show()
    
    # Dynamic Stack
    dynamic_stack = DynamicDataStructures.DynamicStack()
    print ("Total elements   : {0}".format(dynamic_stack.count))
    dynamic_stack.push(10)
    dynamic_stack.push(20)
    print ("Total elements   : {0}".format(dynamic_stack.count))
    
    dynamic_stack.push(30)
    dynamic_stack.push(40)
    dynamic_stack.push(50)
    dynamic_stack.push(60)
    print ("Extracted element: {0}".format(dynamic_stack.pop()))
    print ("Total elements   : {0}".format(dynamic_stack.count))
    print ("Peek             : {0}".format(dynamic_stack.peek()))
    print ("Extracted element: {0}".format(dynamic_stack.pop()))
    print ("Extracted element: {0}".format(dynamic_stack.pop()))
    print ("Extracted element: {0}".format(dynamic_stack.pop()))
    dynamic_stack.show()
    """
    # Dynamic Queue
    dynamic_queue = DynamicDataStructures.DynamicQueue()
    dynamic_queue.enqueue(10)
    dynamic_queue.enqueue(20)
    dynamic_queue.enqueue(30)
    dynamic_queue.enqueue(40)
    dynamic_queue.enqueue(50)
    
    print ("Extracted element: {0}".format(dynamic_queue.dequeue()))
    print ("Total elements   : {0}".format(dynamic_queue.count))
    print ("Peek             : {0}".format(dynamic_queue.peek()))
    print ("Extracted element: {0}".format(dynamic_queue.dequeue()))
    print ("Extracted element: {0}".format(dynamic_queue.dequeue()))
    print ("Extracted element: {0}".format(dynamic_queue.dequeue()))    
    print ("Total elements   : {0}".format(dynamic_queue.count))